package snafu.implementation.actions.kill;

import java.util.List;

import snafu.framework.actions.AbstractAction;
import snafu.framework.actions.Intention;
import snafu.framework.objects.WorldObject;
import snafu.framework.states.StateItself;
import snafu.framework.view.Access;
import snafu.framework.worlds.WorldMap;
import snafu.implementation.states.literals.status.StatusLiteralItself;
import snafu.implementation.states.literals.status.StatusLiteral.Status;

public class KillAction extends AbstractAction {

	public KillAction(List<WorldObject> targets, Intention<?> intention) {
		super(targets, intention);
	}

	@Override
	public void execute(WorldMap worldMap) {
		WorldObject target = targets.get(0);
		// set the agent dead
		((StateItself) target.getState()).setLiteral(new StatusLiteralItself(Status.DEAD, Access.PUBLIC));
		worldMap.removeObject(target);
	}

	@Override
	public String output() {
		return agent + " kills " + targets.get(0);
	}

	@Override
	public boolean supportMultiTargets() {
		return false;
	}

}
